package com.hs.myshell.demo.swt;

import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;

public class SnippetCursor {

public static void main (String [] args) {
	Display display = new Display ();
	final Cursor cursor = display.getSystemCursor(SWT.CURSOR_APPSTARTING);
	Shell shell = new Shell (display);
	shell.setText("Snippet 44");
	shell.open ();
	final Button b = new Button (shell, 0);
	b.setText("Push to set cursor to hand");
	Rectangle clientArea = shell.getClientArea ();
	b.setBounds (clientArea.x + 10, clientArea.y + 10, 200, 200);
	b.addListener (SWT.Selection, e -> b.setCursor (cursor));
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
}
